#ifndef SIM900A_H
#define SIM900A_H

#include <QThread>
#include <QSerialPortInfo>
#include <QSerialPort>

#include "sqlite.h"
#include "thread.h"
#include "sqlite.h"

using namespace std;

//#define LEND_MSG  "60A8501F9605768456FE4E6653735C065230671FFF0C8BF753CA65F65F528FD83002"//
#define LEND_MSG "您借阅的图书即将到期，请及时归还。"
//#define ORDER_MSG "60A898847EA6768456FE4E665DF24E0A67B6FF0C6B228FCE60A86765501F96053002"//
#define ORDER_MSG "您预约的图书已上架，欢迎您来借阅。"

class SIM900A : public QThread
{
    Q_OBJECT
public:
    static SIM900A *Get()
    {
        static SIM900A s;
        return &s;
    }

    string phone;
    string msg;

    User_t user;
    int mode = 0;
    QSerialPort *serial;
    explicit SIM900A();

    void run() override;
    QString writeDate(std::string data);
    void setUser(QString phone, QString msg);
signals:

};

#endif // SIM900A_H
